home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-2.iso / extra / helpful.zip / firewall < prev    next >
Text File  |  1995-08-21  |  30KB  |  778 lines

  1.   Firewalling and Proxy Server HOWTO
  2.   David Rudder, drig@execpc.com
  3.   v0.2, 17 July 1995
  4.  
  5.   This document is designed to teach the basics of setting up a firewall
  6.   on a Linux based PC.  Also covered is the installation and use of
  7.   Proxy Servers to allow greater access to the Internet from behind a
  8.   firewall.
  9.  
  10.   1.  Introduction
  11.  
  12.   Firewalls have gained great fame recently as the ultimate in Internet
  13.   Security.  Like most things that gain fame, with that fame has come
  14.   misunderstanding.  This HOWTO will go over the basics of what a
  15.   firewall is, how to set one up, what proxy servers are, how to set up
  16.   proxy servers, and the applications of this technology outside of the
  17.   security realm.
  18.  
  19.  
  20.   1.1.  Feedback
  21.  
  22.   Any feedback is very welcome.  I am particularly looking for feedback
  23.   from people who use Macintosh computers, as the information I have on
  24.   them is scanty.  PLEASE PLEASE PLEASE REPORT ANY INACCURACIES IN THIS
  25.   PAPER!!!  I am human, and prone to making mistakes.  If you find any,
  26.   fixing them is of my highest interest.  I will try to answer all e-
  27.   mail, but I am busy, so don't get insulted if I don't.
  28.  
  29.  
  30.   My email address is drig@execpc.com.
  31.  
  32.  
  33.   1.2.  Disclaimer
  34.  
  35.   This document is meant as an introduction to how Firewalls and Proxy
  36.   Servers work.  I am not, not do I pretend to be, a security expert.  I
  37.   am just some guy who has read to much and likes computers more than
  38.   people.  I AM NOT RESPONSIBLE FOR ANY DAMAGES INCURRED DUE TO ACTIONS
  39.   TAKEN BASED ON THIS DOCUMENT.   Please, I am writing this to help get
  40.   people acquainted with this subject, and I am not ready to stake my
  41.   life on the accuracy of what is in here.
  42.  
  43.  
  44.   1.3.  Copyright
  45.  
  46.   Unless otherwise stated, Linux HOWTO documents are copyrighted by
  47.   their respective authors. Linux HOWTO documents may be reproduced and
  48.   distributed in whole or in part, in any medium physical or electronic,
  49.   as long as this copyright notice is retained on all copies. Commercial
  50.   redistribution is allowed and encouraged; however, the author would
  51.   like to be notified of any such distributions.
  52.  
  53.   All translations, derivative works, or aggregate works incorporating
  54.   any Linux HOWTO documents must be covered under this copyright notice.
  55.   That is, you may not produce a derivative work from a HOWTO and impose
  56.   additional restrictions on its distribution. Exceptions to these rules
  57.   may be granted under certain conditions; please contact the Linux
  58.   HOWTO coordinator at the address given below.
  59.  
  60.   In short, we wish to promote dissemination of this information through
  61.   as many channels as possible. However, we do wish to retain copyright
  62.   on the HOWTO documents, and would like to be notified of any plans to
  63.   redistribute the HOWTOs.
  64.  
  65.   If you have any questions, please contact David Rudder
  66.   <drig@execpc.com>.
  67.   1.4.  My Reasons for Writing This
  68.  
  69.   There were a lot of discussions on comp.os.linux.* over the past year
  70.   or so asking for Firewalling help.  It seemed as if no one was going
  71.   to answer these.  I assumed that the reason was that no one knew how.
  72.   So, I set aside some time to play with Firewalling and teach myself
  73.   it.  This document is in response to those requests.
  74.  
  75.  
  76.   1.5.  TODO
  77.  
  78.  
  79.   o  Learn how to do this on a Macintosh
  80.  
  81.   o  Learn different Windows TCP/IP packages
  82.  
  83.   o  Find a good UDP proxy server that works with Linux
  84.  
  85.  
  86.   1.6.  Further Readings
  87.  
  88.  
  89.   o  The Documentation for the TIS Firewall Toolkit
  90.  
  91.   o  The NET-2 HOWTO
  92.  
  93.   o  The PPP HOWTO
  94.  
  95.   o  The Ethernet HOWTO
  96.  
  97.   o  The Multiple Ethernet Mini HOWTO
  98.  
  99.   o  Networking with Linux
  100.  
  101.   o  TCP/IP Network Administrator's Guide by O'Reilly and Associates
  102.  
  103.   The Firewall Toolkit by TIS has a collection of the best documentation
  104.   I have found on firewalls and related constructs.  For more on the
  105.   Firewall Toolkit, look for the section Firewalling Software.
  106.  
  107.  
  108.   2.  Understanding Firewalls
  109.  
  110.   A Firewall is a term used for a part of a car.  In cars, Firewalls are
  111.   physical objects that separate the engine block from the passenger
  112.   compartment.  They are meant to protect the passenger in case the car
  113.   explodes.
  114.  
  115.   A Firewall in computers is a logical device that protects a private
  116.   network from the public part.  How they work is:
  117.  
  118.  
  119.   1. You take a computer that has routing capabilities (such as a linux
  120.      box)
  121.  
  122.   2. Put in 2 interfaces (ie Serial ports, Ethernet, Token Ring, etc)
  123.  
  124.   3. Turn off IP forwarding
  125.  
  126.   4. Connect the internet to one interface
  127.  
  128.   5. Connect the protected network to the other interface
  129.  
  130.  
  131.   Now, you have two distinct networks, which share a computer.  The
  132.   firewall computer, from now on named "firewall", can reach both the
  133.   protected network and the internet.  The protected network can not
  134.   reach the internet, and the internet can not reach the protected
  135.   network.
  136.  
  137.  
  138.   For someone to reach the internet from inside the protected network,
  139.   one must telnet to firewall, and use the internet from there.
  140.   Accordingly, in order to get into the protected network, one must go
  141.   through the firewall first.
  142.  
  143.  
  144.   This provides excellent security against attacks from the internet.
  145.   If someone wants to make a concerted attack against the protected
  146.   network, they must go through the firewall first, making it a two-
  147.   step, and thus much harder, attack.  If someone wants to attack the
  148.   protected network via a more common method, such as mail bombing, or
  149.   the infamous "Internet Worm", they will not be able to reach the
  150.   protected network.  This makes for excellent protection.
  151.  
  152.  
  153.   2.1.  Drawbacks with Firewalls
  154.  
  155.   The biggest problem with firewalls is that they greatly inhibit the
  156.   access to the internet from the inside.  Basically, they reduce the
  157.   usage of the internet to that which one would have via a dial-up shell
  158.   account.  Having to login to firewall and then do all internet access
  159.   is a severe restriction.  Programs like Netscape, which require a
  160.   direct internet connection, will not work from behind a firewall.  The
  161.   answer to these problems is having a Proxy Server.
  162.  
  163.  
  164.   2.2.  Proxy Servers
  165.  
  166.   Proxy servers are constructs that allow direct internet access from
  167.   behind a firewall.  How they work is they open a socket on the server,
  168.   and allow communication via that socket to the internet.  For example,
  169.   if my computer, drig is inside the protected network, and I want to
  170.   browse the Web using Netscape, I would set up a proxy server on
  171.   firewall.  The proxy server would be configured to allow requests from
  172.   my computer, trying for port 80, to connect to its port 1080, and it
  173.   would then redirect all requests to the proper places.
  174.  
  175.  
  176.   Anyone that has used TIA or TERM has seen this concept before.  Using
  177.   these two programs, you can redirect a port.  A friend had TIA setup
  178.   to allow anyone using 192.251.139.21 port 4024 to connect to his Web
  179.   Server.  The proxy server works like this, but backwards.  To connect
  180.   to anyone else's port 80, you must use port 1080 (or whichever port
  181.   you set it for).
  182.  
  183.  
  184.   The great thing about proxy servers is that they are completely
  185.   secure, when configured correctly.  They will not allow someone in
  186.   through them.
  187.  
  188.  
  189.   3.  Setting This All Up
  190.  
  191.  
  192.   3.1.  Hardware requirements
  193.  
  194.   For our example, the computer is a 486-DX66, 8 megs of memory, 500
  195.   megs Linux partition, with a PPP connection to it internet provider
  196.   over a 14.4 modem.  This setup is your basic Linux box.  To make it a
  197.   firewall, we add one NE2000 Ethernet card.  It is then connected to 3
  198.   PC's running Windows 3.1 with Trumpet Winsock and 2 Suns running SunOS
  199.   4.1.  This setup was chosen because it is a fairly common and they are
  200.   both platforms that I am familiar with.  I imagine much of the same
  201.   stuff that I am talking about here is doable with Macs, but since I
  202.   don't use Macs frequently enough, I don't really know.
  203.  
  204.  
  205.   3.2.  Setting up the Software
  206.  
  207.   So, you have one Linux box connected to the net via a 14.4 PPP line.
  208.   You then have a Ethernet network connected to the Linux box and all
  209.   the other computers.  First, you must recompile the Linux kernel with
  210.   the appropriate options.  At this point, I would look at the Kernel
  211.   HOWTO, the Ethernet HOWTO, and the NET-2 HOWTO.  Then, do a "make
  212.   config":
  213.  
  214.  
  215.   1. Turn on Networking Support
  216.  
  217.   2. Turn on TCP/IP Networking
  218.  
  219.   3. Turn off IP Forwarding (CONFIG_IP_FORWARD).
  220.  
  221.   4. Turn on IP Firewalling
  222.  
  223.   5. Probably turn on IP accounting.  Seems prudent since we are setting
  224.      up a security measure
  225.  
  226.   6. Turn on Networking Device Support
  227.  
  228.   7. We turn on PPP and Ethernet support, but that depends on your
  229.      interfaces
  230.  
  231.   Then, we recompile, reinstall the kernel and reboot.  The interfaces
  232.   should show up in the boot-up sequence, and we should be fine.  If
  233.   not, go over the other HOWTOs again until it is working.
  234.  
  235.  
  236.   3.3.  Configuring the Network Addresses
  237.  
  238.   This is the real interesting part.  Since we do not want the internet
  239.   to have access, we do not need to use real addresses.  One good C
  240.   Class to use is 192.168.2.xxx, which was set aside as a dummy test
  241.   domain.  Thus, no one uses it, and it will not conflict with any
  242.   requests for the outside.  So, in this configuration, only one real IP
  243.   address is needed. The others are free for the taking and will not
  244.   affect the network at all.
  245.  
  246.   Assign the real IP to the serial port used for the PPP.  Assign
  247.   192.168.2.1 to the Ethernet card on firewall.  Assign all the other
  248.   machines in the protected network some number in that domain.
  249.  
  250.  
  251.   3.4.  Testing it out
  252.  
  253.   First, try to ping the internet from firewall.  I used to use
  254.   nic.ddn.mil as my test point.  It's still a good test, but has proven
  255.   to be less reliable than I had hoped.  If it doesn't work at first,
  256.   try pinging a couple other places that are not connected to your LAN.
  257.   If this doesn't work, then your PPP is incorrectly setup.  Reread the
  258.   Net-2 HOWTO, and try again.
  259.  
  260.   Now, try pinging between hosts within the protected network.  All the
  261.   computers should be able to ping each other.  If not, go over the
  262.   NET-2 HOWTO again and work on the network some more.
  263.  
  264.  
  265.   Then, every machine in the protected network should be able to ping
  266.   firewall.  If not, go back again.  Remember, they should be able to
  267.   ping 192.168.2.1, not the PPP address.
  268.  
  269.   Then, try to ping the PPP address of firewall from inside the
  270.   protected network.  If you can, then you have not turned off IP
  271.   Forwarding and you will have to recompile the kernel.  Having assigned
  272.   the protected network the 192.168.2.1 domain means that no packets
  273.   will be routed to this network anyway, but it is safer to have IP
  274.   Forwarding turned off anyway.  This leaves the control in your hands,
  275.   not in the hands of your PPP provider.
  276.  
  277.  
  278.   Finally, ping each machine within the protected network from firewall.
  279.   By this time, there should be no problems.
  280.  
  281.  
  282.   Now, you have your basic firewall setup.
  283.  
  284.  
  285.   3.5.  Securing the Firewall
  286.  
  287.   The firewall is no good if it is left wide open to attacks.  First,
  288.   look at /etc/inetd.conf.  This file is what is called a "super
  289.   server".  It runs a bunch of the server daemons as they are requested.
  290.   Examples are:
  291.  
  292.  
  293.   o  Telnet
  294.  
  295.   o  Talk
  296.  
  297.   o  FTP
  298.  
  299.   o  Daytime
  300.  
  301.   Turn off everything that is not needed.  Definitely turn off netstat,
  302.   systat, tftp, bootp, and finger.  You might also want to turn off
  303.   telnet, and only allow rlogin, or vica-versa.  To turn a service off,
  304.   merely put a # in front of it.  Then, send a SIG-HUP to the process by
  305.   typing kill -HUP <pid>, where pid is the process number of inetd.
  306.   This will make inetd re-read its configuration file (inetd.conf) and
  307.   restart.  Test it out by telneting to port 15 on firewall, the netstat
  308.   port.  If you get an output of netstat, you have not restarted it
  309.   correctly.
  310.  
  311.  
  312.   4.  Firewalling Software
  313.  
  314.   4.1.  Available packages
  315.  
  316.   Strict firewalling does not need any software except the Linux kernel
  317.   and the base networking packages (inetd, telnetd and telnet, ftpd and
  318.   ftp).  But, a firewall like this is extremely restrictive and not very
  319.   useful.
  320.  
  321.  
  322.   So, software packages have been made to make a firewall more useful.
  323.   The one that I would like to examine in most detail is a package
  324.   called "socks" which is a proxy server.  But, there are two other
  325.   programs that you might want to keep in mind.  I would like to give
  326.   you a short review of them now.
  327.  
  328.  
  329.  
  330.  
  331.   4.2.  The TIS Firewall Toolkit
  332.  
  333.   TIS has put out a collection of programs designed to facilitate
  334.   firewalling.  The programs do basically the same thing as the Socks
  335.   package, but with a different design strategy.  Where Socks has one
  336.   program that covers all Internet transactions, TIS has provided one
  337.   program for each utility that wishes to use the firewall.
  338.  
  339.   To better contrast the two, lets take the example of World Wide Web
  340.   and Telnet access.  With Socks, you set up one configuration file and
  341.   one daemon.  Through this file and daemon, both Telnet and WWW are
  342.   enabled, as well as any other service that you have not disabled.
  343.  
  344.   With the TIS toolkit, you set up one daemon for each WWW and Telnet,
  345.   as well as configuration files for each.  After you have done this,
  346.   other Internet access is still prohibited until explicitly set up.  If
  347.   a daemon for a specific utility has not been provided (like talk),
  348.   there is a "plug-in" daemon, but it is neither as flexible, nor as
  349.   easy to set up, as the other tools.
  350.  
  351.   This might seem a minor difference, but it makes a major difference.
  352.   Socks allows you to be sloppy.  With a poorly set up Socks server,
  353.   someone from the inside could gain more access to the Internet than
  354.   was originally intended.  With the TIS toolkit, the people on the
  355.   inside have only the access the system administrator wants them to
  356.   have.
  357.  
  358.   Socks is easier to set up, easier to compile and allows for greater
  359.   flexibility.  The TIS toolkit is more secure if you want to regulate
  360.   the users inside the protected network.  Both provide absolute
  361.   protection from the outside.
  362.  
  363.  
  364.   4.3.  TCP Wrapper
  365.  
  366.   TCP wrapper is not a firewalling utility, but it allows for many of
  367.   the same effects.  Using TCP wrapper, you can control who has access
  368.   to your machine and to what services as well as keep logs of the
  369.   connections.  It does basic forgery detection also.
  370.  
  371.   TCP wrapper is not covered more extensively here because of a couple
  372.   of reasons.
  373.  
  374.  
  375.   o  It is not a real firewall.
  376.  
  377.   o  To use it, you have to be connected to the Internet, thus you have
  378.      to have an IP address.
  379.  
  380.   o  It only controls the machine it is installed on, and is thus not
  381.      good for a network.  Firewalls can protect every machine of every
  382.      architecture.  TCP wrapper won't work on Macintoshes and MS Windows
  383.      machines.
  384.  
  385.  
  386.   4.4.  Ipfw and Ipfw Admin
  387.  
  388.  
  389.  
  390.   5.  The Proxy Server
  391.  
  392.   5.1.  Setting up the Proxy Server
  393.  
  394.   The proxy server requires additional software.  You can get this
  395.   software from
  396.   ftp://sunsite.unc.edu/pub/Linux/system/Network/misc/socks-linux-
  397.   src.tgz.  There is also an example config file in that directory
  398.   called "socks-conf".  Uncompress and untar the files into a directory
  399.   on your system, and follow the instructions on how to make it.  I had
  400.   a couple problems in making it.  Make sure that the Makefiles are
  401.   correct.  Some are, some are not.
  402.  
  403.   One important thing to note is that the proxy server needs to be added
  404.   to /etc/inetd.conf.  You must add a line:
  405.  
  406.   socks   stream  tcp     nowait  nobody  /usr/local/etc/sockd    sockd
  407.  
  408.   to tell the server to run when requested.
  409.  
  410.  
  411.   5.2.  Configuring the Proxy Server
  412.  
  413.   The socks program needs two separate configuration files.  One to tell
  414.   the access allowed, and one to route the requests to the appropriate
  415.   proxy server.  The access file should be housed on the server.  The
  416.   routing file should be housed on every Un*x machine.  The DOS and,
  417.   presumably, Macintosh computers will do their own routing.
  418.  
  419.  
  420.   5.2.1.  The Access File
  421.  
  422.   With socks4.2 Beta, the access file is called "sockd.conf".  It should
  423.   contain 2 lines, a permit and a deny line.   Each line will have three
  424.   entries:
  425.  
  426.   o  The Identifier (permit/deny)
  427.  
  428.   o  The IP address
  429.  
  430.   o  The address modifier
  431.  
  432.   The identifier is either permit or deny.  You should have both a
  433.   permit and a deny line.
  434.  
  435.   The IP address holds a four byte address in typical IP dot notation.
  436.   Ie 192.168.2.0.
  437.  
  438.   The address modifier is also a typical IP address four byte number.
  439.   It works like a netmask.  Envision this number to be 32 bits (1s or
  440.   0s).  If the bit is a 1, the corresponding bit of the address that it
  441.   is checking must match the corresponding bit in the IP address field.
  442.   For instance, if the line is:
  443.  
  444.   permit 192.168.2.23 255.255.255.255
  445.  
  446.   then, it will permit only the IP address that matches every bit in
  447.   192.168.2.23, eg, only 192.168.2.3.  The line:
  448.  
  449.   permit 192.168.2.0 255.255.255.0
  450.  
  451.   will permit every number within group 192.168.2.0 through
  452.   192.168.2.255, the whole C Class domain.   One should not have the
  453.   line:
  454.  
  455.   permit 192.168.2.0 0.0.0.0
  456.  
  457.   as this will permit every address, regardless.
  458.  
  459.   So, first permit every address you want to permit, and then deny the
  460.   rest.  To allow everyone in the domain 192.168.2.xxx, the lines:
  461.  
  462.  
  463.   permit 192.168.2.0 255.255.255.0
  464.  
  465.   deny 0.0.0.0 0.0.0.0
  466.  
  467.   will work nicely.  Notice the first "0.0.0.0" in the deny line.  With
  468.   a modifier of 0.0.0.0, the IP address field does not matter.  All 0's
  469.   is the norm because it is easy to type.
  470.  
  471.   More than one entry of each is allowed.
  472.  
  473.   Specific users can also be granted or denied access.  This is done via
  474.   ident authentication.  Not all systems support ident, including
  475.   Trumpet Winsock, so I will not go into it here.  The documentation
  476.   with socks is quite adequate on this subject.
  477.  
  478.  
  479.   5.2.2.  The Routing File
  480.  
  481.   The routing file in socks is poorly named "socks.conf".  I say "poorly
  482.   named" because it is so close to the name of the access file that it
  483.   is easy to get the two confused.
  484.  
  485.  
  486.   The routing file is there to tell the socks clients when to use socks
  487.   and when not to.  For instance, in our network, 192.168.2.3 will not
  488.   need to use socks to talk with 192.168.2.1, firewall.  It has a direct
  489.   connection in via Ethernet.  It defines 127.0.0.1, the loopback,
  490.   automatically.  Of course you do not need socks to talk to yourself.
  491.   There are three entries:
  492.  
  493.   o  deny
  494.  
  495.   o  direct
  496.  
  497.   o  sockd
  498.  
  499.   Deny tells socks when to reject a request.  This entry has the same
  500.   three fields as in sockd.conf, identifier, address and modifier.
  501.   Generally, since this is also handled by sockd.conf, the access file,
  502.   the modifier field is set to 0.0.0.0.  If you want to preclude
  503.   yourself from calling any place, you can do it here.
  504.  
  505.  
  506.   The direct entry tells which addresses to not use socks for.  These
  507.   are all the addresses that can be reached without the proxy server.
  508.   Again we have the three fields, identifier, address and modifier.  Our
  509.   example would have
  510.  
  511.   direct 192.168.2.0 255.255.255.0
  512.  
  513.   Thus going direct for any on our protected network.
  514.  
  515.  
  516.   The sockd entry tells the computer which host has the socks server
  517.   daemon on it.  The syntax is:
  518.  
  519.   sockd @=<serverlist> <IP address> <modifier>
  520.  
  521.   Notice the @= entry.  This allows you to set the IP addresses of a
  522.   list of proxy servers.  In our example, we only use one proxy server.
  523.   But, you can have many to allow a greater load and for redundancy in
  524.   case of failure.
  525.  
  526.  
  527.   The IP address and modifier fields work just like in the other
  528.   examples.  You specify which addresses go where through these.
  529.   5.2.3.  DNS from behind a Firewall
  530.  
  531.   Setting up Domain Name service from behind a firewall is a relatively
  532.   simple task.  You need merely to set up the DNS on the firewalling
  533.   machine.  Then, set each machine behind the firewall to use this DNS.
  534.  
  535.  
  536.   5.3.  Working With a Proxy Server
  537.  
  538.  
  539.   5.3.1.  Unix
  540.  
  541.   To have your applications work with the proxy server, they need to be
  542.   "sockified".  You will need two different telnets, one for direct
  543.   communication, one for communication via the proxy server.  Socks
  544.   comes with instructions on how to sockify a program, as well as a
  545.   couple pre-sockified programs.  If you use the sockified version to go
  546.   somewhere direct, socks will automatically switch over to the direct
  547.   version for you.  Because of this, we want to rename all the programs
  548.   on our protected network and replace them with the sockified programs.
  549.   "Finger" becomes "finger.orig", "telnet" becomes "telnet.orig", etc.
  550.   You must tell socks about each of these via the include/socks.h file.
  551.  
  552.  
  553.   Certain programs will handle routing and sockifying itself.  Netscape
  554.   is one of these.  You can use a proxy server under Netscape by
  555.   entering the server's address (192.168.2.1 in our case) in the SOCKs
  556.   field under Proxies.  Each application will need at least a little
  557.   messing with, regardless of how it handles a proxy server.
  558.  
  559.  
  560.   5.3.2.  MS Windows with Trumpet Winsock
  561.  
  562.   Trumpet Winsock comes with built in proxy server capabilities.  In the
  563.   "setup" menu, enter the IP address of the server, and the addresses of
  564.   all the computers reachable directly.  Trumpet will then handle all
  565.   outgoing packets.
  566.  
  567.  
  568.   5.4.  Getting the Proxy Server to work with UDP Packets
  569.  
  570.   The socks package works only with TCP packets, not UDP.  This makes it
  571.   quite a bit less useful.  Many useful programs, such as talk and
  572.   Archie, use UDP.  There is a package designed to be used as a proxy
  573.   server for UDP packets called UDPrelay, by Tom Fitzgerald
  574.   <fitz@wang.com>.  Unfortunately, at the time of this writing, it is
  575.   not compatible with Linux.
  576.  
  577.  
  578.   5.5.  Drawbacks with Proxy Servers
  579.  
  580.   The proxy server is, above all, a security device.  Using it to
  581.   increase internet access with limited IP addresses will have many
  582.   drawbacks.  A proxy server will allow greater access from inside the
  583.   protected network to the outside, but will keep the inside completely
  584.   unaccessible from the outside.  This means no servers, talk or Archie
  585.   connections, or direct mailing to the inside computers.  These
  586.   drawbacks might seem slight, but think of it this way:
  587.  
  588.   o  You have left a report you are doing on your computer inside a
  589.      firewall protected network.  You are at home, and decide that you
  590.      would like to go over it.  You can not.  You can not reach your
  591.      computer because it is behind the firewall.  You try to log into
  592.      firewall first, but since everyone has proxy server access, no one
  593.      has set up an account for you on it.
  594.  
  595.   o  Your daughter goes to college.  You want to email her.  You have
  596.      some private things to talk about, and would rather have your mail
  597.      sent directly to your machine.  You trust your systems
  598.      administrator completely, but still, this is private mail.
  599.  
  600.   o  The inability to use UDP packets represents a big drawback with the
  601.      proxy servers.  I imagine UDP capabilities will be coming shortly.
  602.  
  603.   FTP causes another problem with a proxy server.  When geting or doing
  604.   an ls, the FTP server opens a socket on the client machine and sends
  605.   the information through it.  A proxy server will not allow this, so
  606.   FTP doesn't particularly work.
  607.  
  608.   And, proxy servers run slow.  Because of the greater overhead, almost
  609.   any other means of getting this access will be faster.
  610.  
  611.   Basically, if you have the IP addresses, and you are not worried about
  612.   security, do not use a firewall and/or proxy servers.  If you do not
  613.   have the IP addresses, but you are also not worried about security,
  614.   you might also want to look into using an IP emulator, like Term,
  615.   Slirp or TIA.  Term is available from ftp://sunsite.unc.edu, Slirp is
  616.   available from ftp://blitzen.canberra.edu.au/pub/slirp, and TIA is
  617.   available from marketplace.com.  These packages will run faster, allow
  618.   better connections, and provide a greater level of access to the
  619.   inside network from the internet.  Proxy servers are good for those
  620.   networks which have a lot of hosts that will want to connect to the
  621.   internet on the fly, with one setup and little work after that.
  622.  
  623.  
  624.   6.  Advanced Configurations
  625.  
  626.   There is one configuration I would like to go over before wrapping
  627.   this document up.  The one I have just outlined will probably suffice
  628.   for most people.  However, I think the next outline will show a more
  629.   advanced configuration that can clear up some questions.  If you have
  630.   questions beyond what I have just covered, or are just interested in
  631.   the versatility of proxy servers and firewalls, read on.
  632.  
  633.  
  634.   6.1.  A large network with emphasis on security
  635.  
  636.   Say, for instance, you are the leader of the Milwaukee 23rd Discordian
  637.   Cabal.  You wish to network your site.  You have 50 computers and a
  638.   subnet of 32 (5 bits) IP numbers.  You have various levels of access.
  639.   You tell your disciples different things according to each level.
  640.   Obviously, you would want to protect certain parts of the network from
  641.   the disciples that are not in that level.
  642.  
  643.  
  644.   Disclaimer: I am not a member of the Discordians.  I do not know their
  645.   terminology, nor do I really care.  I am using them as an example
  646.   only.  Please send all flames to
  647.  
  648.   The levels are:
  649.  
  650.   1. The external level.  This is the level that gets shown to
  651.      everybody.  Basically, this is the ranting and raving about Eris,
  652.      Goddess of Discord, and all the rest of the drivel.
  653.  
  654.   2. Sage  This is the level of people who have gotten beyond the
  655.      external level.  Here is where you tell them that discord and
  656.      structure are really one, and that Eris is also Jehovah.
  657.  
  658.   3. Adept  Here is where the real plan is.  In this level is stored all
  659.      the information on how the Discordian Society is going to take over
  660.      the world through a devious, yet humorous, plan involving Newt
  661.      Gingrich, Wheaties Cereal, O.J. Simpson, and five hundred crystals,
  662.      all erroneously marked "6.5 MHz".
  663.  
  664.  
  665.   6.1.1.  The Network Setup
  666.  
  667.   The IP numbers are arranged as:
  668.  
  669.   o  1 number is 192.168.2.255, which is the broadcast address and is
  670.      not usable.
  671.  
  672.   o  23 of the 32 IP addresses are allocated to 23 machines that will be
  673.      accessible to the internet.
  674.  
  675.   o  1 extra IP goes to a linux box on that network
  676.  
  677.   o  1 extra goes to a different linux box on that network.
  678.  
  679.   o  2 IP #'s go to the router
  680.  
  681.   o  4 are left over, but given domain names paul, ringo, john, and
  682.      george, just to confuse things a bit.
  683.  
  684.   o  The protected networks both have the addresses 192.168.2.xxx
  685.  
  686.   Then, two separate networks are built, each in different rooms.  They
  687.   are routed via Infrared Ethernet so that they are completely invisible
  688.   to the outside room.  Luckily, infrared Ethernet works just like
  689.   normal Ethernet (or so i think), so we can just think of them like
  690.   normal.
  691.  
  692.   These networks are each connected to one of the linux boxes with an
  693.   extra IP address.
  694.  
  695.   There is a file server connecting the two protected networks.  This is
  696.   because the plans for taking over the world involves some of the
  697.   higher sages.  The file server holds the address 192.168.2.17 for the
  698.   sage network and 192.168.2.23 for the adept network.  It has to have
  699.   different IP addresses because it has to have different Ethernet
  700.   cards.  IP Forwarding on it is turned off.
  701.  
  702.   IP Forwarding on both Linux boxes is also turned off.  The router will
  703.   not forward packets destined for 192.168.2.xxx unless explicitly told
  704.   to do so, so the internet will not be able to get in.  The reason for
  705.   turning off IP Forwarding here is so that packets from the sage
  706.   network will not be able to reach the adept network, and vica versa.
  707.  
  708.   The NFS server can also be set to offer different files to the
  709.   different networks.  This can come in handy, and a little trickery
  710.   with symbolic links can make it so that the common files can be shared
  711.   with all.  Using this setup and another Ethernet card can offer this
  712.   one file server for all three networks.
  713.  
  714.  
  715.   6.1.2.  The Proxy Setup
  716.  
  717.   Now, since all three levels want to be able to monitor the network for
  718.   their own devious purposes, all three need to have net access.  The
  719.   external network is connected directly into the internet, so we don't
  720.   have to mess with proxy servers here.  The adept and sage networks are
  721.   behind firewalls, so it is necessary to set up proxy servers here.
  722.  
  723.   Both networks will be setup very similarly.  They both have the same
  724.   IP addresses assigned to them.  I will throw in a couple of
  725.   parameters, just to make things more interesting though.
  726.  
  727.   1. No one can use the file server for internet access.  This exposes
  728.      the file server to viruses and other nasty things, and it is rather
  729.      important, so its off limits.
  730.  
  731.   2. We will not allow Sage access to the World Wide Web.  They are in
  732.      training, and this kind of information retrieval power might prove
  733.      to be damaging.
  734.  
  735.   So, the sockd.conf file on the sage linux box will have this line:
  736.  
  737.   deny 192.168.2.17 255.255.255.255
  738.  
  739.   and on the adept machine:
  740.  
  741.   deny 192.168.2.23 255.255.255.255
  742.  
  743.   And, the sage linux box will have this line
  744.  
  745.   deny 0.0.0.0 0.0.0.0 eq 80
  746.  
  747.   This says to deny access to all machines trying to access the port
  748.   equal (eq) to 80, the http port.  This will still allow all other
  749.   services, just deny Web access.
  750.  
  751.   Then, both files will have:
  752.  
  753.   permit 192.168.2.0 255.255.255.0
  754.  
  755.   to allow all the computers on the 192.168.2.xxx network to use this
  756.   proxy server except for those that have already been denied (ie. the
  757.   file server and Web access from the sage network).
  758.  
  759.  
  760.   The sage sockd.conf file will look like:
  761.  
  762.   deny 192.168.2.17 255.255.255.255
  763.  
  764.   deny 0.0.0.0 0.0.0.0 eq 80
  765.  
  766.   permit 192.168.2.0 255.255.255.0
  767.  
  768.   and the adept file will look like:
  769.  
  770.   deny 192.168.2.23 255.255.255.255
  771.  
  772.   permit 192.168.2.0 255.255.255.0
  773.  
  774.  
  775.   This should configure everything correctly.  Each network is isolated
  776.   accordingly, with the proper amount of interaction.  Everyone should
  777.   be happy.  Now, look out for your 6.5 MHz crystals
  778.